from Structure import Deque

def palchecker(aString):
    chardeque = Deque()

    for ch in aString:
        chardeque.addFront(ch) # 这里用addRear亦可

    stillEqual = True

    while chardeque.size() > 1 and stillEqual:
        first = chardeque.removeFront()
        last = chardeque.removeRear()
        if first != last:
            stillEqual = False

    return stillEqual

mystring = "rologr"
if palchecker(mystring):
    print("是回文")
else:
    print("不是回文")